Repository navigation
#273 - Use trigger_deprecation() instead of trigger_error(E_USER_DEPRECATED) - #286
Merged
Merged
Conversation
…ECATED)
- Require symfony/deprecation-contracts (^2.5|^3, already installed through
the Symfony components).
- Replace the 5 @trigger_error(..., E_USER_DEPRECATED) calls by
trigger_deprecation('cleverage/process-bundle', <version>, ...), with the
version that introduced each deprecation: 2.0.4 (CallbackTransformer
additional_parameters, TaskConfiguration::getErrors()), 5.1 (EventDispatcherTask
class name listeners #189, initialization failure #222), 5.2
(MappingTransformer array target path #117). "since v5" removed from the
messages, now given by the prefix.
- Tests: full messages of every deprecation (new TaskConfigurationTest and
CallbackTransformerTest::testAdditionalParametersAreDeprecated).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #273: trigger the deprecations with
trigger_deprecation()(symfony/deprecation-contracts) instead of@trigger_error(..., E_USER_DEPRECATED). The messages are prefixed with the package and the version (Since cleverage/process-bundle 5.1: ...), and grouped as such by the PHPUnit bridge and the profiler.Changes
symfony/deprecation-contracts^2.5|^3(already installed through the Symfony components;trigger_deprecation()has the same signature in both majors).CallbackTransformeradditional_parametersoption2.0.40f02b54, first tag containing itTaskConfiguration::getErrors()2.0.4e533bef, first tag containing itEventDispatcherTaskevent_nameis set5.1ProcessManager::initialize()5.1MappingTransformer5.2"since v5" is removed from the two messages that had it (now given by the prefix); the rest of the messages is unchanged, except
getErrors()("Deprecated method, use getErrorOutputs instead" →The "…\TaskConfiguration::getErrors()" method is deprecated, use "getErrorOutputs()" instead.).Tests
ProcessManagerInitializationTest,MappingTransformerTest,EventDispatcherTaskTest(exact message instead of a substring), newCallbackTransformerTest::testAdditionalParametersAreDeprecated(and none without the option), newTaskConfigurationTest::testGetErrorsIsDeprecated(assertContains: PHP 8.4+ also triggers its own deprecation for the#[\Deprecated]attribute of the method).composer update(PHP 8.5): 906 tests OK, PHPStan, PHP-CS-Fixer, Rector OK.Requirements
Breaking changes
None: same
E_USER_DEPRECATEDlevel and conditions. Code matching the exact deprecation messages (e.g. tests withexpectUserDeprecationMessage()) must take theSince cleverage/process-bundle <version>:prefix into account.🤖 Generated with Claude Code